package com.itheima.teacher.service;

import com.itheima.pojo.Order;
import com.itheima.teacher.client.OrderClient;
import com.itheima.teacher.mapper.TeacherMapper;
import com.itheima.teacher.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author ：mengw9
 * @date ：Created By 2020/9/22 19:56
 * @description：
 * @version:
 */
@Service
public class TeacherService {
    @Autowired
    TeacherMapper teacherMapper;

    @Autowired
    OrderClient orderClient;

    public List<Teacher> queryTeacher() {
        Example example = new Example(Teacher.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("Tname","张三");
        return this.teacherMapper.selectByExample(example);

    }

    public List<Order> queryAllOrder() {

       return this.orderClient.findAllOrder();
    }
}
